#include "xBone.h"
#include "xSkeleton.h"
#include "xRenderObject.h"


namespace XE
{

	xBone::xBone(const xString& name,xSkeleton* pSkel, xBone* pParent)
		:xNode(pParent,name),m_pSkel(pSkel)
	{

	}


	void xBone::Reset()
	{
        // m_LocMatrix = m_OffsetMatrix;
		 size_t size = m_ChildNode.size();
		 for(size_t i = 0;i<size;++i)
		 {
			  static_cast<xBone*>(m_ChildNode.at(i))->Reset();
		 }
	}



	//bool xBone::AddTagRenderObject(xRenderObject* pObje)
	//{

	//	if(pObje==NULL||HasTagObject(pObje))
	//		return  false;


	//	return true;
	//}

	bool  xBone::HasTagObject(xRenderObject* pObje)
	{
		if(pObje==NULL)
			return NULL;
		xRenderObjectVector::iterator it = std::find(m_TagVector.begin(),m_TagVector.end(),pObje);
		if(it==m_TagVector.end())
			return false;
		return true;

	}


}